clear all
set more off
cd "/Users/yasenov/Dropbox (IPL)/RefugeeBan/Data"

use "WRAPS/wraps.dta"

isid year state city origin

gen STATE = substr(fips, 1,2)
gen COUNTY = substr(fips,3,3)

keep if year <= 2016

collapse (sum) refugees, by(STATE COUNTY)

merge m:1 STATE COUNTY using "shapefiles/gz_2010_us_050_00_500k/gz_2010_us_050_00_500k_data.dta", nogen

replace refugee = . if refugee == 0

spmap refugees using "shapefiles/gz_2010_us_050_00_500k/gz_2010_us_050_00_500k_coor.dta", ///
	id(_ID) ///
	clmethod(quantile) ///
	ylabel(,angle(30)) ///
	fcolor(OrRd) ///
	clnumber(4) ///
	legend(size(medium) label(1 "0")) ///
	graphregion(margin(0 0)) plotregion(margin(zero))
graph export "../results/fig_map.pdf", replace
